<?php
namespace app\validate;

use think\Validate;

class login extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */
	protected $rule = [
        'phone' => [ 'require', 'mobile' ],
        'password' => [ 'require', 'max' => 20, 'min' => 5 ]
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */
    protected $message = [
        'phone' => '请填写正确的手机号',
        'phone.require' => '请填写手机号',
        'password' => '请填写正确的密码',
        'password.require' => '请填写密码'
    ];

    protected $scene = [
        'index' => [ 'phone', 'password' ]
    ];
}
